What is remark-cli?
remark-cli is a command-line interface for the remark processor, which is a tool for processing Markdown content. It allows you to lint, format, and transform Markdown files using plugins.
What are remark-cli's main functionalities?
Linting Markdown files
This command lints all Markdown files in the current directory using the recommended linting rules provided by the 'remark-preset-lint-recommended' plugin.
remark . --use remark-preset-lint-recommended
Formatting Markdown files
This command formats all Markdown files in the current directory and writes the changes back to the files. The '--output' flag specifies that the changes should be saved.
remark . --output
Transforming Markdown files with plugins
This command transforms all Markdown files in the current directory to HTML using the 'remark-html' plugin and writes the changes back to the files.
remark . --use remark-html --output
Other packages similar to remark-cli
markdownlint-cli
markdownlint-cli is a command-line interface for the markdownlint library, which is used to lint Markdown files. It focuses primarily on linting and does not offer the same level of extensibility with plugins as remark-cli.
prettier
Prettier is an opinionated code formatter that supports multiple file types, including Markdown. While it is primarily used for formatting, it does not offer the same level of Markdown-specific linting and transformation capabilities as remark-cli.
markdown-it
markdown-it is a Markdown parser that can be extended with plugins. It is more focused on parsing and rendering Markdown to HTML, and does not provide a command-line interface or the same level of linting and formatting capabilities as remark-cli.
Command-line interface for remark.
Installation
npm:
npm install remark-cli
Usage
$ remark readme.md --use toc --output
$ remark . --use preset-lint-markdown-style-guide
CLI
See unified-args, which provides the interface,
for more information on all available options.
Usage: remark [options] [path | glob ...]
CLI to process markdown with remark using plugins
Options:
-h --help output usage information
-v --version output version number
-o --output [path] specify output location
-r --rc-path <path> specify configuration file
-i --ignore-path <path> specify ignore file
-s --setting <settings> specify settings
-e --ext <extensions> specify extensions
-u --use <plugins> use plugins
-p --preset <presets> use presets
-w --watch watch for changes and reprocess
-q --quiet output only warnings and errors
-S --silent output only errors
-f --frail exit with 1 on warnings
-t --tree specify input and output as syntax tree
--file-path <path> specify path to process as
--tree-in specify input as syntax tree
--tree-out output syntax tree
--[no-]stdout specify writing to stdout (on by default)
--[no-]color specify color in report (on by default)
--[no-]config search for configuration files (on by default)
--[no-]ignore search for ignore files (on by default)
Examples:
# Process `input.md`
$ remark input.md -o output.md
# Pipe
$ remark < input.md > output.md
# Rewrite all applicable files
$ remark . -o
License
MIT © Titus Wormer